import re

# test1 将str中的数字替换为空
str = 'Python is the best development language in the world 123456789 000'
result = re.sub('\d+', '', str)
print(result)

# test2 将str中的数字替换为java
result1 = re.sub('\d+', 'java', str)
print(result1)